The following sections cover general tasks
associated with managing and configuring a Server Core system via the
command prompt after the installation is complete. As an alternative, an
administrator can use the SCONFIG utility to configure general
settings.
Launching the Command Prompt in a Server Core Installation
Remember, the Start menu does not exist.
Because of this, one of the most important tasks an administrator must
understand when managing a Server Core installation is how to launch a
PowerShell console session. The following steps will assist you:
1. Press Ctrl+Alt+Delete.
2. Select Start Task Manager.
3. On the Windows Task Manager screen, select File, New Task (Run).
4. In the Create New Task dialog box, type powershell.exe, and then click OK.
Changing the Server Core Administrator’s Password
After the initial password has been set, the syntax to change the administrator password is as follows:
Net user administrator *
After the command has been executed, you are
prompted to type a password for the user. Enter the password and then
retype it for the confirmation process. It is a best practice to use a
complex password when assigning passwords to the administrator account
and the default password policy on the server will require complex
passwords.
Changing the Server Core Machine Name
After the Server Core installation is
complete, another common task is to change the machine name of the
server. By default, Windows automatically generates and assigns a server
name starting with WIN and followed by a string of characters. The syntax to change the Server Core machine name follows:
netdom renamecomputer <CurrentComputerName> /newname:<NewComputerName>
When executing this command, replace the <CurrentComputerName> argument with the existing hostname (which can be found using the hostname
command) and the <NewComputerName>
argument with the new machine name for the Server Core installation.
Changing the server name from Win-123 to ABCDC2 is depicted in the
following example:
netdom renamecomputer Win-123 /newname:ABCDC2
The same function can be performed using PowerShell with the following command:
Rename-computer –NewName ABCDC2
Assigning a Static IPV4 IP Address and DNS Settings
Another common Server Core management task is
assigning an IP address, including the primary and secondary DNS
settings. Before this task can be executed, you must run the following
command to obtain and identify the names of the network interfaces
installed on the server. This includes capturing the unique ID
associated with each network interface. To display a list of network
interfaces, including their respective unique IDs, run the following
command:
netsh interface ipv4 show interfaces
Note
Netsh commands can usually be abbreviated to
make typing easier once the administrator is familiar with the command.
For example, the preceding command can also be executed by running the
following:
Netsh int ipv4 sh int
The next step is to make a note of the network
interface name and unique ID that you must change. The ID is located in
the leftmost column and is referred to as Idx. This is depicted in the
output of the netsh interface ipv4 show interfaces
command, as displayed in Figure 1.
Figure 1. Reviewing the Idx ID for a network interface.
Note
If you plan to change the IP address settings
on more than one interface, take note of all the interface names and Idx
unique IDs.
Now that you have captured the names and IDs, use the following syntax to change the IP address for a desired interface:
netsh interface ipv4 set address name="<ID>" source=static address=<StaticIP>
mask=<SubnetMask> gateway=<DefaultGateway>
Replace the ID argument with the network
interface name or ID. In addition, enter the static IP address, subnet
mask, and default gateway in subsequent arguments, as follows:
netsh interface ipv4 set address name="1" source=static ad
dress=192.168.115.10 mask=255.255.255.0 gateway=192.168.115.1.
The final step when configuring the network
interface is to enter a primary and secondary DNS entry for the
interface. Do this by using the following syntax:
netsh interface ipv4 add dnsserver name="<ID>" address=<DNSIP> index=1
The same command is used
and repeated when entering more than one DNS entry. However, increment
the index each time. When finalized, run IP Config /all to verify the IP
address settings.
The same function can be performed using PowerShell with the following commands:
Get-NETIPInterface
Set-NetIPAddress –InterfaceIndex 12 –IPv4Address 192.168.115.10 –PrefixLength 24
–DefaultGateway 192.168.115.1
Set-DNSClientServerAddress –InterfaceIndex 12 –ServerAddresses "DNSIP1","DNSIP2"
Adding the Server Core System to a Domain
The following script illustrates the basic syntax to add a Server Core system to a Windows domain:
Netdom join <computername> /domain:<domain> /OU:<ou path> /userd:<domain>\<username>
/passwordD:*
Input the domain name and the target OU.
Supply the user account and password for an account that has permissions
to add computers to the domain.
The same function can be performed using PowerShell with the following commands:
Add-Computer -domainname <domain> -OUPath "OU=OU,=Domain,DC=com"
Activating the Server Core System
Activating a Server Core system can be
achieved in two easy steps. First, you enter a product key, and then you
activate the server. The syntax to enter a product key is as follows:
slmgr.vbs –ipk<productkey>
After the product key has been successfully entered, you activate the server by typing in the following command.
slmgr.vbs –ato
Using SCONFIG to Configure a Server Core Installation
As mentioned previously, Windows Server 2012
includes a utility to make the initial configuration or a core
installation easier. The SCONFIG utility, which has been available since
Windows Server 2008 R2, is very easy to use and is usually the
preferred configuration option if scripting is not required.
The utility can be executed by running
sconfig.exe in the core installation command prompt and presents the set
of options shown in Figure 2.
Figure 2. SCONFIG utility.
Server Core Roles and Feature Installations
The typical Windows server roles can be
configured on a Server Core installation. The following server roles are
currently supported on a Server Core installation:
• Active Directory Certificate Services
• Active Directory Domain Services (AD DS)
• Active Directory Lightweight Directory Services (AD LDS)
• Active Directory Rights Management Server
• DHCP Server
• DNS Server
• File and Storage Services
• Hyper-V
• Print and Document Services
• Remote Access Server
• Remote Desktop Services (partial support)
• Connection Broker
• Licensing
• Virtualization Host only
• Volume Activation Services
• Web Server (IIS)
• Windows Deployment Services
• Windows Software Update Services
The following are some of the features that are also supported on a Server Core installation:
• .NET Framework 4.5
• BITS Compact Server
• BitLocker Drive Encryption
• BranchCache
• Failover Clustering
• Group Policy Management
• IP Address Management (IPAM) Server
• Multipath I/O
• Network Load Balancing
• Remote Server Administration Tools (partial)
• Simple Network Management Protocol (SNMP)
• Telnet Client
• Windows PowerShell 2.0
• Windows Server Backup
Note
The following command lists all the potential server roles and associated features:
Dism /online /get-features /format:table
The OCSetup command-line program familiar from
earlier versions is still available (but deprecated) for setting up and
configuring the server roles and features on a Server Core
installation. You can configure the OCSetup command-line options using
the following syntax:
ocsetup.exe [/?] [/h] [/help] component [/log:file] [/norestart] [/passive] [/quiet]
[/unattendfile:file] [/uninstall] [/x: parameter]
Table 1 describes each of the options that are available when using the OCSetup command-line program.
Table 1. Available Command Options for OCSetup
Using Powershell to Install a Server Role on a Server Core Installation
In addition to OCSetup, Powershell can be used to install roles and features, as follows:
1. Run PowerShell by executing powershell.exe in the command prompt.
2. Run import-module servermanager
to enable Server Manager features within the PowerShell session.
3. Use Get-WindowsFeature
to identify installed and available roles and features.
4. Use Add-WindowsFeature
to add the required role or feature. Table 2 outlines an example of common server role installations using Add-WindowsFeature
.
Table 2. Server Role Installation Command Lines with PowerShell
The previous sections are
a prelude to some of the common Server Core command-line arguments for
installing and configuring elements on a Windows Server 2012 Server Core
installation. For a full list of command-line arguments, visit the
Microsoft website and conduct a search for Windows Server 2012 Server
Core.
Installing the Active Directory Domain Services Role
Installation of AD DS is more complex and
vital to the operation of the environment and therefore deserves more
detailed attention. Installation of the role using Add-WindowsFeature AD-domain-services
will install the required binaries but not configure the server as a domain controller.
In earlier versions, the recommended tool for
that is the dcpromo utility. The problem is that dcpromo normally starts
a wizard with a GUI that is not supported on Server Core. As a result,
the dcpromo utility on server core is a command-line utility that
requires input by supplying the operation parameters or by using an
answer file.
The dcpromo utility can accept more than 30
different operation parameters. Although this might seem like a dizzying
array of options, few command lines will use all of them. Refer to the
TechNet dcpromo command reference at http://technet.microsoft.com/en-us/library/cc732887(WS.10).aspx
for a complete list and explanation of each parameter. You can use this
reference to build the correct dcpromo command line or create an
unattend file suitable for your core domain controller.
As with many other aspects of the operating
system, Windows Server 2012 provides PowerShell support to perform that
same function. Promoting a domain controller using PowerShell is very
convenient and is based on the ADDSDeployment module, which includes the
following commands:
• Install-ADDSForest
• Install-ADDSDomain
• Install-ADDSDomainController
These commands are available by first loading the appropriate module using Import-Module ADDSDeployment
.
Then, all that’s required is using the correct command from above
depending on whether the goal is to deploy a new forest, add a domain to
an existing forest, or add a domain controller to an existing domain.
All the commands accept the required parameters, which you can discover
by using the Get-Help
cmdlet.
For example, use the following command to get the syntax for the Install-ADDSForest
cmdlet:
Get-Help Install-ADDSForest
Then, using the following syntax to install a new Windows 2012 forest with a root domain called abc.com:
Install-ADDSForest –ForestMode "Win8" –DomainMode "Win8" –DomainName "abc.com"
–DomainNetBIOSName "ABC" –DatabasePath "C:\Windows\NTDS" –LogPath "C:\Windows\NTDS"
–SYSVOLPath "C:\Windows\SYSVOL" –InstallDNS:$true –CreateDNSDelegation:$false
–RebootOnCompletion:$true –Force:$true
You will be prompted for the safe mode boot
password, and the forest will be created. The server reboots upon
completion as specified in the command.